package com.szrt.javaweb.ch01.dyn.spring;


import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ActorDaoTest {
	
	@Autowired
	 private ActorService actorService;
	
	
	
	@Test
	public void testName() throws Exception {
		
		
		ClassPathXmlApplicationContext ioc = new ClassPathXmlApplicationContext("com/szrt/javaweb/ch01/dyn/spring/applicationContext.xml");
		
		ActorEntity entity = new ActorEntity();
		entity.setTeacherName("xyzabc");
		entity.setTeacherAge(3333);
		actorService.insert(entity);
		
	/*	Object obj = ioc.getBean("actorService");
		
		ActorService service = (ActorService) obj;
		
		ActorEntity entity = new ActorEntity();
		entity.setTeacherName("xyzabc");
		entity.setTeacherAge(3333);
		service.insert(entity );*/
	}
	

}
